package com.jt.www.domain.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jt.www.domain.enums.common.AuditStatusEnum;
import com.jt.www.domain.enums.common.PushStatusEnum;
import com.jt.www.domain.po.OfflineEndorse;
import com.jt.www.enums.endorse.EndorsementsTypeEnum;
import com.jt.www.util.DateUtils;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;

/**
 * 线下录入导出
 * Created by shaoyn on 2020/05/22.
 */
public class OfflineEndorseOutputDTO {

    @ApiModelProperty(value = "保单号")
    private String policyNo;

    @ApiModelProperty(value = "批单号")
    private String endorseNo;

    @ApiModelProperty(value = "线下批单类型 02-批减,03-批加,04-批退")
    private String endorseType;

    @ApiModelProperty(value = "产品编号")
    private String productCode;

    @ApiModelProperty(value = "产品名称")
    private String productName;

    @ApiModelProperty(value = "批单起期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String startDate;

    @ApiModelProperty(value = "批单止期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String endDate;

    @ApiModelProperty(value = "出单日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String insureDate;

    @ApiModelProperty(value = "保单保费")
    private BigDecimal premium;

    @ApiModelProperty(value = "状态 1：待审核 2：审核退回  3：审核通过")
    private String auditStatus;

    @ApiModelProperty(value = "审核意见")
    private String auditOpinion;

    @ApiModelProperty(value = "操作人名称")
    private String operatorName;

    @ApiModelProperty(value = "推送状态")
    private String pushStatus;

    @ApiModelProperty(value = "审核时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String auditTime;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String createTime;

    @ApiModelProperty(value = "录单时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private String inputTime;

    @ApiModelProperty(value = "审核状态描述 1：待审核 2：审核退回  3：审核通过")
    private String pushStatusDesc;

    @ApiModelProperty(value = "审核状态描述 1：待审核 2：审核退回  3：审核通过")
    private String auditStatusDesc;

    @ApiModelProperty(value = "审核状态描述 1：待审核 2：审核退回  3：审核通过")
    private String endorseTypeDesc;


    public OfflineEndorseOutputDTO(OfflineEndorse offlineEndorse) {
        this.policyNo = offlineEndorse.getPolicyNo();
        this.endorseNo = offlineEndorse.getEndorseNo();
        this.endorseType = offlineEndorse.getEndorseType();
        this.productCode = offlineEndorse.getProductCode();
        this.productName = offlineEndorse.getProductName();
        if (null != offlineEndorse.getStartDate()) {
            this.startDate = DateUtils.converDate(offlineEndorse.getStartDate());
        }
        if (null != offlineEndorse.getEndDate()) {
            this.endDate = DateUtils.converDate(offlineEndorse.getEndDate());
        }
        if (null != offlineEndorse.getInsureDate()) {
            this.insureDate = DateUtils.converDate(offlineEndorse.getInsureDate());
        }
        if (null != offlineEndorse.getInputTime()) {
            this.inputTime = DateUtils.converDate(offlineEndorse.getInputTime());
        }
        this.premium = offlineEndorse.getPremium();
        this.auditStatus = offlineEndorse.getAuditStatus();
        this.auditOpinion = offlineEndorse.getAuditOpinion();
        this.operatorName = offlineEndorse.getOperatorName();
        this.pushStatus = offlineEndorse.getPushStatus();
        if (null != offlineEndorse.getAuditTime()) {
            this.auditTime = DateUtils.converDate(offlineEndorse.getAuditTime());
        }
        if (null != offlineEndorse.getCreateTime()) {
            this.createTime = DateUtils.converDate(offlineEndorse.getCreateTime());
        }
        this.auditStatusDesc = AuditStatusEnum.getDescByCode(offlineEndorse.getAuditStatus());
        this.pushStatusDesc = PushStatusEnum.getDescByCode(offlineEndorse.getPushStatus());
        this.endorseTypeDesc = EndorsementsTypeEnum.getDescByType(offlineEndorse.getEndorseType());
    }


    public String getPolicyNo() {
        return policyNo;
    }

    public void setPolicyNo(String policyNo) {
        this.policyNo = policyNo;
    }

    public String getEndorseNo() {
        return endorseNo;
    }

    public void setEndorseNo(String endorseNo) {
        this.endorseNo = endorseNo;
    }

    public String getEndorseType() {
        return endorseType;
    }

    public void setEndorseType(String endorseType) {
        this.endorseType = endorseType;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getInsureDate() {
        return insureDate;
    }

    public void setInsureDate(String insureDate) {
        this.insureDate = insureDate;
    }

    public BigDecimal getPremium() {
        return premium;
    }

    public void setPremium(BigDecimal premium) {
        this.premium = premium;
    }

    public String getAuditStatus() {
        return auditStatus;
    }

    public void setAuditStatus(String auditStatus) {
        this.auditStatus = auditStatus;
    }

    public String getAuditOpinion() {
        return auditOpinion;
    }

    public void setAuditOpinion(String auditOpinion) {
        this.auditOpinion = auditOpinion;
    }

    public String getOperatorName() {
        return operatorName;
    }

    public void setOperatorName(String operatorName) {
        this.operatorName = operatorName;
    }

    public String getPushStatus() {
        return pushStatus;
    }

    public void setPushStatus(String pushStatus) {
        this.pushStatus = pushStatus;
    }

    public String getAuditTime() {
        return auditTime;
    }

    public void setAuditTime(String auditTime) {
        this.auditTime = auditTime;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    public String getInputTime() {
        return inputTime;
    }

    public void setInputTime(String inputTime) {
        this.inputTime = inputTime;
    }

    public String getPushStatusDesc() {
        return pushStatusDesc;
    }

    public void setPushStatusDesc(String pushStatusDesc) {
        this.pushStatusDesc = pushStatusDesc;
    }

    public String getAuditStatusDesc() {
        return auditStatusDesc;
    }

    public void setAuditStatusDesc(String auditStatusDesc) {
        this.auditStatusDesc = auditStatusDesc;
    }

    public String getEndorseTypeDesc() {
        return endorseTypeDesc;
    }

    public void setEndorseTypeDesc(String endorseTypeDesc) {
        this.endorseTypeDesc = endorseTypeDesc;
    }
}
